use ggez::mint::Point2;

pub struct Walker {
    location: Point2<f32>,
    xspeed: f32,
    yspeed: f32
}

impl Walker {
    pub fn new() -> Walker{
        Walker{location : Point2 { x: 100.0, y: 100.0 }, xspeed: 1.0, yspeed: 3.3}
    }
    pub fn get_location(& self) -> Point2<f32> {
        self.location
    }
    pub fn step(&mut self) {
        self.location.x += self.xspeed;
        self.location.y += self.yspeed;
        if (self.location.x>800.0) || (self.location.x<0.0) {
            self.xspeed *= -1.0
        }
        if (self.location.y>600.0) || (self.location.y<0.0) {
            self.yspeed *= -1.0
        }
    }
}
